import { StoreKeys } from '@/common/enum'
import type { MemberType } from '@/common/type'
import { defineStore } from 'pinia'
import { cn_members } from '../common/cn'

// 用户列表
export const useMembers = defineStore(StoreKeys.members, {
  state: () => {
    return {
      members: cn_members,
      todos: [],
    }
  },
  actions: {
    setMembers(_members: MemberType[]) {
      this.members = [..._members]
    },
  },
  getters: {
    doneMembers(state) {
      return state.members.filter((member) => member.userNo !== '')
    },
  },
})
